﻿@model TestSys.Models.groups

@{
    ViewBag.Title = "EditGroup";
    Layout = "~/Views/Admin/_AdminLayout.cshtml";
}

<h2>EditGroup</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>GroupModel</legend>

        <div class="editor-field">
            @Html.HiddenFor(model => model.GroupID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.GroupName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.GroupName)
            @Html.ValidationMessageFor(model => model.GroupName)
        </div>
        @if (Model.testsforgroups.Count == 0)
        {
            <p>There are no tests yet.</p>
        }
        else
        {
            foreach (var item in Model.testsforgroups)
            {
                <ul>
                    <li>@item.tests.TestName</li>
                </ul>
            }
        }
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "ManageGroups")
</div>
